﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Web.Application
{
    /// <summary>
    /// 登陆消息持久化接口
    /// </summary>
    public interface ISerialization
    {
        /// <summary>
        /// 持久化，并保存
        /// </summary>
        /// <param name="userid"></param>
        /// <param name="username"></param>
        /// <param name="email"></param>
        /// <param name="isSave"></param>
        void Serialization(int userid, string username, string email, bool isSave);
        /// <summary>
        /// 持久化，不保存，关闭浏览器即消失
        /// </summary>
        /// <param name="userid"></param>
        /// <param name="username"></param>
        /// <param name="email"></param>
        void Serialization(int userid, string username, string email);
        /// <summary>
        /// 返回userid
        /// </summary>
        int UserID { get; }
        /// <summary>
        /// 返回username
        /// </summary>
        string UserName { get; }
        /// <summary>
        /// 返回email
        /// </summary>
        string Email { get; }
        /// <summary>
        /// 是否处于登陆状态
        /// </summary>
        bool IsLogin { get; }
        /// <summary>
        /// 清空消息
        /// </summary>
        void Clear();
    }
}
